package com.zhkj.lib.utils

import io.reactivex.Observable
import io.reactivex.subjects.PublishSubject

object RxBus {

    private val bus = PublishSubject.create<Any>()

    fun post(T: Any) {
        bus.onNext(T)
    }

    fun <T> toObservable(type: Class<T>): Observable<T> {
        return bus.ofType(type)
    }
}